@extends('admin.frame_layout')
<?php $top_selected = "会员管理";$page_menu = "会员系谱图" ?>
@section('content')
    <div class="formbody">

        {{--搜索--}}
        <div class="tools">
            <form method="get" id="sform" action="{{route('admin.node.tree')}}">
                <ul class="toolbar">
                    <li>
                        <select name="search_type">
                            <option value="1">按会员名搜索</option>
                            <option value="2">按会员ID搜索</option>
                        </select>
                    </li>
                    <li>
                        <input id="search_str" name="search_str" type="text" placeholder="搜索条件">
                    </li>
                    <li>
                        <a href="javascript:void(0)" onclick="$('#sform').submit()">
                            <span><img src="{{asset('admin/imgs/ico06.png')}}" width="20px"
                                       height="20px"/></span>搜索
                        </a>
                    </li>
                </ul>
            </form>
        </div>

        {{--<div class="formtitle"><span>会员系谱图查看</span></div>--}}
        <div class="node-canvas center-block">
            <div class="node center-block">
                <div class="title"><a
                            href="{{route('admin.node.tree',['id'=>$user->nid])}}">{{$user->username}}</a>
                </div>
                <div class="brand">
                    @if($user->ok_status == \App\Models\MUser::$STATUS_ACTIVATED)
                        <span class="green">已激活会员</span>
                    @else
                        <span class="red">未激活会员</span>
                    @endif
                </div>
                <div class="ab">
                    <div>注册时间</div>
                    <div>激活时间</div>
                </div>
                <div class="ab">
                    <div>{{date("Y-m-d",$user->reg_time)}}</div>
                    <div>{{$user->ok_time == NULL ? "无" : date("Y-m-d",$user->ok_time)}}</div>
                </div>
                <div class="brand">
                    @if($user->bdzx_status == \App\Models\MUser::$BDZX_NO)
                        <span class="red">非报单中心</span>
                    @elseif($user->bdzx_status == \App\Models\MUser::$BDZX_YES)
                        <span class="green">报单中心</span>
                    @elseif($user->bdzx_status ==\App\Models\MUser::$BDZX_APPLY)
                        <span class="red">报单申请中</span>
                    @endif
                </div>
            </div>
            <div class="line">
                <div class="center-block" style="height: 60px;width: 1px;">
                </div>
                <div style="width: 100%;height: 1px;">
                </div>
            </div>
            <div class="node left">
                <?php $a = $user->auser(); ?>
                @if(!empty($a))
                    <div class="title">
                        <a href="{{route('admin.node.tree',['id'=>$a->id])}}">{{$a->username}}</a>
                    </div>
                    <div class="brand">
                        @if($a->ok_status == \App\Models\MUser::$STATUS_ACTIVATED)
                            <span class="green">已激活会员</span>
                        @else
                            <span class="red">未激活会员</span>
                        @endif
                    </div>
                    <div class="ab">
                        <div>注册时间</div>
                        <div>激活时间</div>
                    </div>
                    <div class="ab">
                        <div>{{date("Y-m-d",$a->reg_time)}}</div>
                        <div>{{$a->ok_time == NULL ? "无" : date("Y-m-d",$a->ok_time)}}</div>
                    </div>
                    <div class="brand">
                        @if($a->bdzx_status ==\App\Models\MUser::$BDZX_NO)
                            <span class="red">非报单中心</span>
                        @elseif($a->bdzx_status ==\App\Models\MUser::$BDZX_YES)
                            <span class="green">报单中心</span>
                        @elseif($a->bdzx_status ==\App\Models\MUser::$BDZX_APPLY)
                            <span class="red">报单申请中</span>
                        @endif
                    </div>
                @else
                    <div class="title">
                        <a target="_blank" href="{{route('web.reg.page',['uid'=>$user->id])}}">注册此节点会员(A)</a>
                    </div>
                @endif
            </div>
            <div class="node right">
                <?php $b = $user->buser(); ?>
                @if(!empty($b))
                    <div class="title">
                        <a href="{{route('admin.node.tree',['id'=>$b->id])}}">{{$b->username}}</a>
                    </div>
                    <div class="brand">
                        @if($b->ok_status == \App\Models\MUser::$STATUS_ACTIVATED)
                            <span class="green">已激活会员</span>
                        @else
                            <span class="red">未激活会员</span>
                        @endif
                    </div>
                    <div class="ab">
                        <div>注册时间</div>
                        <div>激活时间</div>
                    </div>
                    <div class="ab">
                        <div>{{date("Y-m-d",$b->reg_time)}}</div>
                        <div>{{$b->ok_time == NULL ? "无" : date("Y-m-d",$b->ok_time)}}</div>
                    </div>
                    <div class="brand">
                        @if($b->bdzx_status ==\App\Models\MUser::$BDZX_NO)
                            <span class="red">非报单中心</span>
                        @elseif($b->bdzx_status ==\App\Models\MUser::$BDZX_YES)
                            <span class="green">报单中心</span>
                        @elseif($b->bdzx_status ==\App\Models\MUser::$BDZX_APPLY)
                            <span class="red">报单申请中</span>
                        @endif
                    </div>
                @else
                    <div class="title">
                        <a target="_blank" href="{{route('web.reg.page',['uid'=>$user->id])}}">注册此节点会员(B)</a>
                    </div>
                @endif
            </div>
        </div>
    </div>
@endsection